<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<head>
<title>学生成绩管理系统</title>
<link rel="stylesheet" type="text/css" id="css" href="../style/main.css" />
<link rel="stylesheet" type="text/css" id="css"
	href="../style/style1.css" />
<link rel="stylesheet" type="text/css" id="css"
	href="../style/style.css" />

<style type="text/css">
<!--
table {
	border-spacing: 1px;
	border: 1px solid #A2C0DA;
}

td, th {
	padding: 2px 5px;
	border-collapse: collapse;
	text-align: left;
	font-weight: normal;
}

thead tr th {
	height: 50px;
	background: #B0D1FC;
	border: 1px solid white;
}

thead tr th.line1 {
	background: #D3E5FD;
}

thead tr th.line4 {
	background: #C6C6C6;
}

tbody tr td {
	height: 35px;
	background: #CBE2FB;
	border: 1px solid white;
	vertical-align: middle;
}

tbody tr td.line4 {
	background: #D5D6D8;
}

tbody tr th {
	height: 35px;
	background: #DFEDFF;
	border: 1px solid white;
	vertical-align: middle;
}

tfoot tr td {
	height: 35px;
	background: #FFFFFF;
	border: 1px solid white;
	vertical-align: middle;
}
-->
</style>

<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/calendar.js"></script>
<script type="text/javascript" src="../js/ajax.js"></script>
<script type="text/JavaScript">
	/*判断是否为数字*/
	function isNumber(str) {
		var Letters = "1234567890";
		for (var i = 0; i < str.length; i = i + 1) {
			var CheckChar = str.charAt(i);
			if (Letters.indexOf(CheckChar) == -1) {
				return false;
			}
		}
		return true;
	}
	/*判断是否为空*/
	function isEmpty(value) {
		return /^\s*$/.test(value);
	}
	function check() {
		if (isEmpty(document.myForm.courseNo.value)) {
			alert("课程编号不能为空！");
			document.myForm.courseNo.focus();
			return false;
		}
		if (isEmpty(document.myForm.tcTeacherNo.value)) {
			alert("教学班号不能为空！");
			document.myForm.tcTeacherNo.focus();
			return false;
		}
		if (!isNumber(document.myForm.tcTeacherNo.value)) {
			alert("教学班号只能为数字！");
			document.myForm.tcTeacherNo.focus();
			return false;
		}
		if (isEmpty(document.myForm.tcLocation.value)) {
			alert("上课地点不能为空！");
			document.myForm.tcLocation.focus();
			return false;
		}
		if (isEmpty(document.myForm.tcCapacity.value)) {
			alert("课程容量不能为空！");
			document.myForm.tcCapacity.focus();
			return false;
		}
		if (!isNumber(document.myForm.tcCapacity.value)) {
			alert("课程容量只能为数字！");
			document.myForm.tcCapacity.focus();
			return false;
		}
		return true;
	}
</script>
</head>
<c:if test="${!(empty sessionScope.message)}">
	<script type="text/javascript">
		alert('<c:out value="${sessionScope.message}"/>');
	</script>
	<c:remove var="message" scope="session" />
</c:if>
<body>
	<div id="btm">
		<div id="main">
			<div id="header">
				<div id="top"></div>
				<div id="logo">
					<h1>任课管理</h1>
				</div>
				<div id="mainnav">
					<ul>
						<li><a href="teacherIndex.jsp">首页</a></li>
						<li><a href="tcServlet?action=list">开设课程</a></li>
						<li><a href="tcServlet?action=checkGrade">成绩提交</a></li>
						<li><a href="tcServlet?action=showTeacher">信息查询</a></li>
						<li><a href="changePwd.jsp">密码修改</a></li>
						<li><a href="../logoutServlet">退出</a></li>
					</ul>
					<span id="right"> <c:choose>
							<c:when test="${sessionScope.user.userType==1}">
								<font color=red>状态：已登录&nbsp;&nbsp;用户类别：教师用户&nbsp;&nbsp;用户名：${sessionScope.user.name}&nbsp;&nbsp;</font>
							</c:when>

							<c:otherwise>
								<font color=red>状态：未登录&nbsp;&nbsp;</font>
							</c:otherwise>
						</c:choose>
					</span>
				</div>
			</div>

			<div id="tabsJ">
				<ul>
					<li><a href="tcServlet?action=list" title="任课管理"><span>任课管理</span></a></li>
					<li><a href="tcServlet?action=listCourse" title="课程查询"><span>课程查询</span></a></li>
				</ul>
			</div>
			<div id="content" align="center">
				<div id="center">
					<BR /> <BR />
					<form name="myForm" action="tcServlet?action=add" method="post">
						<table width="800" align="center" cellpadding="0" cellspacing="0">
							<thead>
								<tr>
									<td width="70%"><h5>教师管理-->添加教师</h5></td>
								</tr>

							</thead>

							<tr>
								<td colspan="2" width="100%">
									<table width="100%">
										<tbody>
											<tr>
												<td align="right">请输入开设课程信息</td>
												<td>注：带<font color="red"> * </font>号的必须填写
												</td>
											</tr>
											<tr>
												<td align="right">课程编号</td>
												<td><input id="courseNo" name="courseNo" /><font
													color="red"> * </font></td>
											</tr>
											<tr>
												<td align="right">教学班号:</td>
												<td><input id="tcTeacherNo" name="tcTeacherNo" /><font
													color="red"> * </font></td>
											</tr>
											<tr>
												<td align="right">上课地点:</td>
												<td><input id="tcLocation" type="tcLocation"
													name="tcLocation" /><font color="red"> * </font></td>
											</tr>
											<tr>
												<td align="right">上课时间:</td>
												<td>星期 <select id="tcTime1" name="tcTime1">
														<option value="1">一</option>
														<option value="2">二</option>
														<option value="3">三</option>
														<option value="4">四</option>
														<option value="5">五</option>
														<option value="6">六</option>
														<option value="7">日</option>
												</select> 第 <select id="tcTime2" name="tcTime2">
														<option value="1">一</option>
														<option value="2">二</option>
														<option value="3">三</option>
														<option value="4">四</option>
														<option value="5">五</option>
														<option value="6">六</option>
												</select> 节 <font color="red"> * </font></td>
											</tr>
											<tr>
												<td align="right">课程容量:</td>
												<td><input id="tcCapacity" name="tcCapacity" /><font
													color="red"> * </font></td>
											</tr>
										</tbody>


										<tr>
											<td align="center" colspan="2"><input type="submit"
												value="提交" onclick="return check();" /> <input type="reset"
												value="重置" /></td>
										</tr>


									</table>
								</td>
							</tr>
						</table>

					</form>



				</div>



			</div>

			<div id="footer">
				<div id="copyright">
					<div id="copy">
						<p align="center">CopyRight&copy;2016</p>
						<p>南京晓庄学院信息工程学院</p>
					</div>
				</div>
				<div id="bgbottom"></div>
			</div>

		</div>
	</div>
</body>
</html>
